Skip to content

fix: use custom path & random filename for ssh auth socket#672

Closed
kiprasmel wants to merge 3 commits intopeaceiris:mainfrom
kiprasmel:fix/use-custom-path-for-ssh-socket
Closed

fix: use custom path & random filename for ssh auth socket#672
kiprasmel wants to merge 3 commits intopeaceiris:mainfrom
kiprasmel:fix/use-custom-path-for-ssh-socket

Conversation

@kiprasmel
Copy link
Copy Markdown

@kiprasmel kiprasmel commented Nov 28, 2021

github action runners can be self-hosted. i am running one inside my server.

turns out, the github action cannot just assume that it's the only one who's using
the server's infrastructure.

this should help w/ the ssh stuff.
fyi, i am not sure 100% if this fixes it:
i tried running the commands here and it helped,
but not sure if it i'll be the case when the action does so, but should be good.

for not overriding the .ssh/config,
for not spamming the .ssh/known_hosts file,

i'll consider creating separate PRs.

Signed-off-by: Kipras Melnikovas kipras@kipras.org

@kiprasmel kiprasmel requested a review from peaceiris as a code owner November 28, 2021 11:56
…server.

turns out, the github action cannot just assume that it's the only one who's using
the server's infrastructure.

this should help w/ the ssh stuff.
fyi, i am not sure 100% if this fixes it:
i tried running the commands here and it helped,
but not sure if it i'll be the case when the action does so, but should be good.

for _not_ overriding the .ssh/config,
for _not_ spamming the .ssh/known_hosts file,

i'll consider creating separate PRs.

Signed-off-by: Kipras Melnikovas <kipras@kipras.org>
@kiprasmel
Copy link
Copy Markdown
Author

kiprasmel commented Nov 28, 2021

btw, how could I test this out myself? i.e. the action

edit: was able to commit the patch into default branch, ran release.sh (had to git config --global commit.gpgSign false beforehand), selected the pre-release tag, found which one it was, specified it when using the github action.

it looks like it worked - the workflow which uses this (my forked) action succeeded. but not sure, since i added extra logging, but i don't see it... 🤷‍♀️

edit 2: ooh, it did indeed work.

but now i see the custom name is only enough once - we need some random stuff in it.

Signed-off-by: Kipras Melnikovas <kipras@kipras.org>
Signed-off-by: Kipras Melnikovas <kipras@kipras.org>
@kiprasmel kiprasmel changed the title fix: use custom path for ssh auth socket fix: use custom path & random filename for ssh auth socket Nov 28, 2021
@kiprasmel
Copy link
Copy Markdown
Author

though, i see that these sockets are getting kept alive, it'd be best to kill them off after we're done - do u know how to best do that?

$ sudo systemctl status actions.runner.sarpik-notes.ubuntu-kiprasorg.service

     Loaded: loaded (/etc/systemd/system/actions.runner.sarpik-notes.ubuntu-kiprasorg.service; enabled; vendor preset: enabled)
     Active: active (running) since Tue 2021-11-16 17:34:14 UTC; 1 weeks 5 days ago
   Main PID: 12820 (runsvc.sh)
      Tasks: 45 (limit: 4617)
     Memory: 893.6M
     CGroup: /system.slice/actions.runner.sarpik-notes.ubuntu-kiprasorg.service
             ├─  12820 /bin/bash /home/kipra/actions-runner/runsvc.sh
             ├─  12831 ./externals/node12/bin/node ./bin/RunnerService.js
             ├─  12861 /home/kipra/actions-runner/bin/Runner.Listener run --startuptype service
             ├─2421374 ssh-agent -a /tmp/ssh-auth.sock
             ├─2454922 ssh-agent -a /tmp/ssh-auth.actions-gh-pages.sock
             ├─2457460 ssh-agent -a /tmp/ssh-auth.actions-gh-pages.3426845734502919.sock
             ├─2458437 ssh-agent -a /tmp/ssh-auth.actions-gh-pages.44133903694018173.sock
             ├─2463233 ssh-agent -a /tmp/ssh-auth.actions-gh-pages.5498097896843337.sock
             ├─2464521 ssh-agent -a /tmp/ssh-auth.actions-gh-pages.32885849867326433.sock
             ├─2465985 ssh-agent -a /tmp/ssh-auth.actions-gh-pages.1994787699815217.sock
             ├─2470559 ssh-agent -a /tmp/ssh-auth.actions-gh-pages.9822269374070316.sock
             ├─2471139 ssh-agent -a /tmp/ssh-auth.actions-gh-pages.5980039622937487.sock
             ├─2471585 ssh-agent -a /tmp/ssh-auth.actions-gh-pages.43799022797008447.sock
             ├─2472071 ssh-agent -a /tmp/ssh-auth.actions-gh-pages.30393747943694094.sock
             ├─2472954 ssh-agent -a /tmp/ssh-auth.actions-gh-pages.3769005973915338.sock
             ├─2474132 ssh-agent -a /tmp/ssh-auth.actions-gh-pages.5836954750703021.sock
             ├─2476110 ssh-agent -a /tmp/ssh-auth.actions-gh-pages.2867237264222926.sock
             ├─2480500 ssh-agent -a /tmp/ssh-auth.actions-gh-pages.10159296301655574.sock
             ├─2481160 ssh-agent -a /tmp/ssh-auth.actions-gh-pages.26975398769592207.sock
             ├─2483028 ssh-agent -a /tmp/ssh-auth.actions-gh-pages.9192360830323691.sock
             ├─2484071 ssh-agent -a /tmp/ssh-auth.actions-gh-pages.8900955366603869.sock
             ├─2492430 ssh-agent -a /tmp/ssh-auth.actions-gh-pages.6486754537601209.sock
             ├─2500807 ssh-agent -a /tmp/ssh-auth.actions-gh-pages.5358562866591079.sock
             ├─2505206 ssh-agent -a /tmp/ssh-auth.actions-gh-pages.16377194997208355.sock
             ├─2507113 ssh-agent -a /tmp/ssh-auth.actions-gh-pages.9356686789579503.sock
             └─2510174 ssh-agent -a /tmp/ssh-auth.actions-gh-pages.27555529470232587.sock

@peaceiris peaceiris added this to the v3.9.0 milestone Dec 21, 2021
@jiminj jiminj mentioned this pull request Dec 22, 2021
3 tasks
@kiprasmel kiprasmel closed this by deleting the head repository Feb 13, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants